package cn.formaggie.service.impl;

import cn.formaggie.dao.CustomerDao;
import cn.formaggie.entity.model.order.Customer;
import cn.formaggie.service.face.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("customerService")
public class CustomerServiceImpl implements CustomerService {
    @Autowired
    private CustomerDao customerDao;

    @Override
    public List<Customer> getAllCustomers() {
        return customerDao.getAllCustomers();
    }

    @Override
    public Customer getCustomerById(Integer id) {
        return customerDao.getCustomerById(id);
    }

    @Override
    public List<Customer> findCustomers(Map<String, Object> map) {
        return customerDao.findCustomers(map);
    }

    @Override
    public Integer getCustomersCount(Map<String, Object> map) {
        return customerDao.getCustomersCount(map);
    }

    @Override
    public Boolean addCustomer(Customer customer) {
        return customerDao.addCustomer(customer)>0?true:false;
    }

    @Override
    public Boolean modifyCustomerInfo(Customer customer) {
        return customerDao.modifyCustomerInfo(customer)>0?true:false;
    }
}
